Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@travetto/yaml
Advanced tools
Install: @travetto/yaml
npm install @travetto/yaml
# or
yarn add @travetto/yaml
In the desire to provide a minimal footprint, the framework provides a minimal YAML parser/serializer to handle standard configuration structure.
YamlUtil is the main access point for this module, and will expose two method, parse
and serialize
.
Code: Simple YAML Parsing
import { YamlUtil } from '@travetto/yaml';
export function main(): void {
const obj = YamlUtil.parse(`
name: Source
age: 20
fields:
sub:
- a
- b
- c
sub2: [1,2,3]
sub3: {"k":5, "v":20}
`);
console.log(JSON.stringify(obj, null, 2));
}
Terminal: Simple YAML Parsing
$ trv main doc/parse.ts
{
"name": "Source",
"age": 20,
"fields": {
"sub": [
"a",
"b",
"c"
],
"sub2": [
1,
2,
3
],
"sub3": {
"k": 5,
"v": 20
}
}
}
Code: Simple YAML Serialization
import { YamlUtil } from '@travetto/yaml';
export function main(): void {
const text = YamlUtil.serialize({
name: 'Source',
age: 20,
fields: {
sub: [
'a',
'b',
'c'
],
sub2: [1, 2, 3],
sub3: { k: 5, v: 20 }
}
});
console.log(text);
}
Terminal: Simple YAML Serialization
$ trv main doc/serialize.ts
name: Source
age: 20
fields:
sub:
- a
- b
- c
sub2:
- 1
- 2
- 3
sub3:
k: 5
v: 20
FAQs
Simple YAML support, provides only clean subset of yaml
The npm package @travetto/yaml receives a total of 37 weekly downloads. As such, @travetto/yaml popularity was classified as not popular.
We found that @travetto/yaml demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.